/*
 * @lc app=leetcode.cn id=2206 lang=golang
 *
 * [2206] 将数组划分成相等数对
 */
package Solutions

// @lc code=start
func divideArray(nums []int) bool {
	mp := make(map[int]bool, len(nums))
	for _, v := range nums {
		if exist, ok := mp[v]; ok {
			mp[v] = !exist
		} else {
			mp[v] = true
		}
	}
	for _, v := range mp {
		if v {
			return false
		}
	}
	return true
}

// @lc code=end
